/*
 * @Author: your name
 * @Date: 2020-12-30 09:28:31
 * @LastEditTime: 2021-01-22 15:53:11
 * @LastEditors: your name
 * @Description: In User Settings Edit
 * @FilePath: /LearnGo/src/SDK/cloud_servic/aliyun/ecs/main.go
 */
package main

import (
	"LearnGo/SDK/aliyun/ecs/utils"
	"fmt"
)

const (
	RegionId        = "cn-qingdao"
	AccessKeyId     = "LTAI4GKANUQb2aLRAgBQELF8"
	AccessKeySecret = "oqj3LoZvKI57kpc8ixWWr4YdteCzX3"
)

func main() {
	list, _ := utils.GetEcsInfo(RegionId, AccessKeyId, AccessKeySecret)
	fmt.Printf("ecs实例：%d台\n", list.TotalCount)
	for _, v := range list.Instances.Instance {
		fmt.Printf("实例名称：%s\n", v.InstanceName)
		fmt.Printf("实例公网IP：%s\n", v.PublicIpAddress.IpAddress)
		fmt.Printf("实例内网IP：%s\n", v.InnerIpAddress.IpAddress)
		fmt.Printf("实例cpu核心数：%d\n", v.CpuOptions.CoreCount)
		fmt.Println()
	}
}
